package com.c1202m.gui;

import com.c1202m.dao.DangNhapDAO;
import com.c1202m.hibernate.entities.QuanTri;
import java.awt.Image;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JPanel;
import org.netbeans.lib.awtextra.AbsoluteConstraints;

public class ATMSystem extends javax.swing.JFrame {

    private int x;
    private int y;
    private int clickOnClock = 0;

    public ATMSystem() {
        initComponents();
        Image icon = getToolkit().getImage(getClass().getResource("/images/app_icon_32.png"));
        setIconImage(icon);
        x = this.getWidth();
        y = this.getHeight();
        motion();
        new ThreadTime().start();
        setAdminInfo(DangNhapDAO.quanTri);
        setVisible(true);
    }

    private void motion() {
        this.setSize(0, 0);
        new Thread(new SizeMonitor(this, x, y)).start();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        lbDateTime = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        txtName = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        txtUserID = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        pwPass = new javax.swing.JPasswordField();
        btnChangePw = new javax.swing.JButton();
        lbImage = new javax.swing.JLabel();
        jToolBar1 = new javax.swing.JToolBar();
        btnClock = new javax.swing.JButton();
        btnLogout = new javax.swing.JButton();
        btnExit = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        btnQuanTri = new javax.swing.JButton();
        btnTaiKhoan = new javax.swing.JButton();
        btnThongKe = new javax.swing.JButton();
        btnHelp = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        mainPanel = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        mnLogout = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mnExit = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        menuHelp = new javax.swing.JMenuItem();
        mnAbout = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("ATM Management System");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lbDateTime.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        lbDateTime.setForeground(new java.awt.Color(204, 0, 0));
        lbDateTime.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lbDateTime.setText("10/21/2011");
        jPanel1.add(lbDateTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 200, 50));

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));

        jLabel3.setForeground(new java.awt.Color(51, 51, 51));
        jLabel3.setText("Họ tên :");
        jLabel3.setPreferredSize(new java.awt.Dimension(40, 20));

        txtName.setEditable(false);
        txtName.setPreferredSize(new java.awt.Dimension(120, 20));

        jLabel4.setForeground(new java.awt.Color(51, 51, 51));
        jLabel4.setText("Email :");
        jLabel4.setPreferredSize(new java.awt.Dimension(40, 20));

        txtUserID.setEditable(false);
        txtUserID.setPreferredSize(new java.awt.Dimension(120, 20));

        jLabel6.setForeground(new java.awt.Color(51, 51, 51));
        jLabel6.setText("Mật khẩu :");
        jLabel6.setPreferredSize(new java.awt.Dimension(55, 20));

        pwPass.setEditable(false);
        pwPass.setPreferredSize(new java.awt.Dimension(120, 20));

        btnChangePw.setForeground(new java.awt.Color(0, 0, 255));
        btnChangePw.setText("Đổi mật khẩu ? click ở đây...");
        btnChangePw.setContentAreaFilled(false);
        btnChangePw.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnChangePw.setFocusable(false);
        btnChangePw.setMargin(new java.awt.Insets(2, 0, 2, 0));
        btnChangePw.setPreferredSize(new java.awt.Dimension(140, 25));
        btnChangePw.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnChangePwActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(pwPass, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtUserID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnChangePw, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtUserID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pwPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addComponent(btnChangePw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 55, Short.MAX_VALUE))
        );

        jPanel1.add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 350, 200, 210));

        lbImage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Manager.jpg"))); // NOI18N
        lbImage.setText("jLabel5");
        jPanel1.add(lbImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, 200, 230));

        jToolBar1.setBackground(new java.awt.Color(255, 255, 255));
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        btnClock.setBackground(new java.awt.Color(255, 255, 255));
        btnClock.setForeground(new java.awt.Color(0, 0, 153));
        btnClock.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/clock.png"))); // NOI18N
        btnClock.setText("Đồng hồ");
        btnClock.setToolTipText("Ngày tháng/Thời gian");
        btnClock.setFocusable(false);
        btnClock.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnClock.setMargin(new java.awt.Insets(2, 9, 2, 9));
        btnClock.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnClock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClockActionPerformed(evt);
            }
        });
        jToolBar1.add(btnClock);

        btnLogout.setBackground(new java.awt.Color(255, 255, 255));
        btnLogout.setForeground(new java.awt.Color(0, 0, 153));
        btnLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logout.png"))); // NOI18N
        btnLogout.setText("Đăng xuất");
        btnLogout.setToolTipText("Đăng xuất hệ thống");
        btnLogout.setFocusable(false);
        btnLogout.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLogout.setMargin(new java.awt.Insets(2, 8, 2, 8));
        btnLogout.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLogoutActionPerformed(evt);
            }
        });
        jToolBar1.add(btnLogout);

        btnExit.setBackground(new java.awt.Color(255, 255, 255));
        btnExit.setForeground(new java.awt.Color(0, 0, 153));
        btnExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit.png"))); // NOI18N
        btnExit.setText("Thoát");
        btnExit.setToolTipText("Thoát khỏi hệ thống");
        btnExit.setFocusable(false);
        btnExit.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnExit.setMargin(new java.awt.Insets(2, 10, 2, 10));
        btnExit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExitActionPerformed(evt);
            }
        });
        jToolBar1.add(btnExit);

        jPanel1.add(jToolBar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 200, 50));

        jPanel2.setBackground(new java.awt.Color(18, 97, 174));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_1.png"))); // NOI18N
        btnQuanTri.setToolTipText("Quản lý tài khoản quản trị");
        btnQuanTri.setBorder(null);
        btnQuanTri.setContentAreaFilled(false);
        btnQuanTri.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnQuanTri.setFocusable(false);
        btnQuanTri.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnQuanTriMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnQuanTriMouseExited(evt);
            }
        });
        btnQuanTri.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnQuanTriActionPerformed(evt);
            }
        });
        jPanel2.add(btnQuanTri, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 60, 100, 50));

        btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_1.png"))); // NOI18N
        btnTaiKhoan.setToolTipText("Quản lý tài khoản khách hàng");
        btnTaiKhoan.setBorder(null);
        btnTaiKhoan.setContentAreaFilled(false);
        btnTaiKhoan.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnTaiKhoan.setFocusable(false);
        btnTaiKhoan.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnTaiKhoanMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnTaiKhoanMouseExited(evt);
            }
        });
        btnTaiKhoan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTaiKhoanActionPerformed(evt);
            }
        });
        jPanel2.add(btnTaiKhoan, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 60, 100, 50));

        btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_1.png"))); // NOI18N
        btnThongKe.setToolTipText("Thống kê giao dịch");
        btnThongKe.setBorder(null);
        btnThongKe.setContentAreaFilled(false);
        btnThongKe.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnThongKe.setFocusable(false);
        btnThongKe.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnThongKeMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnThongKeMouseExited(evt);
            }
        });
        btnThongKe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnThongKeActionPerformed(evt);
            }
        });
        jPanel2.add(btnThongKe, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 60, 100, 50));

        btnHelp.setForeground(new java.awt.Color(240, 240, 240));
        btnHelp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/arrow.png"))); // NOI18N
        btnHelp.setText("Help & Support");
        btnHelp.setContentAreaFilled(false);
        btnHelp.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnHelp.setFocusable(false);
        btnHelp.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        btnHelp.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        btnHelp.setMargin(new java.awt.Insets(0, 2, 2, 0));
        btnHelp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnHelpMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnHelpMouseExited(evt);
            }
        });
        btnHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHelpActionPerformed(evt);
            }
        });
        jPanel2.add(btnHelp, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 20, 110, -1));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/label_top.png"))); // NOI18N
        jPanel2.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 760, 110));

        mainPanel.setBackground(new java.awt.Color(255, 255, 255));
        mainPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/welcome.png"))); // NOI18N
        mainPanel.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 90, 660, 90));

        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/welcome_gif.gif"))); // NOI18N
        mainPanel.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 210, 610, 30));

        jPanel2.add(mainPanel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 110, 760, 460));

        jMenu1.setText("File");

        mnLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logout_16.png"))); // NOI18N
        mnLogout.setText("Logout");
        mnLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnLogoutActionPerformed(evt);
            }
        });
        jMenu1.add(mnLogout);
        jMenu1.add(jSeparator1);

        mnExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit_16.png"))); // NOI18N
        mnExit.setText("Exit");
        mnExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnExitActionPerformed(evt);
            }
        });
        jMenu1.add(mnExit);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Help");

        menuHelp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        menuHelp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/userguide_16.png"))); // NOI18N
        menuHelp.setText("User guide");
        menuHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuHelpActionPerformed(evt);
            }
        });
        jMenu2.add(menuHelp);

        mnAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/about_16.png"))); // NOI18N
        mnAbout.setText("About us");
        mnAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnAboutActionPerformed(evt);
            }
        });
        jMenu2.add(mnAbout);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 572, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnTaiKhoanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTaiKhoanActionPerformed
        kichHoatTaiKhoan = true;
        kichHoatThongKe = false;
        kichHoatQuanTri = false;
        btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_3.png")));
        btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_1.png")));
        btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_1.png")));
        callJPanel(taiKhoanController);
    }//GEN-LAST:event_btnTaiKhoanActionPerformed

    private void btnThongKeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnThongKeActionPerformed
        kichHoatTaiKhoan = false;
        kichHoatThongKe = true;
        kichHoatQuanTri = false;
        btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_1.png")));
        btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_3.png")));
        btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_1.png")));
        callJPanel(thongKeController);
    }//GEN-LAST:event_btnThongKeActionPerformed

    private void btnQuanTriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuanTriActionPerformed
        kichHoatTaiKhoan = false;
        kichHoatThongKe = false;
        kichHoatQuanTri = true;
        btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_1.png")));
        btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_1.png")));
        btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_3.png")));
        callJPanel(quanTriController);
    }//GEN-LAST:event_btnQuanTriActionPerformed

    private void btnTaiKhoanMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnTaiKhoanMouseEntered
        if (!kichHoatTaiKhoan) {
            btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_2.png")));
        }
    }//GEN-LAST:event_btnTaiKhoanMouseEntered

    private void btnTaiKhoanMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnTaiKhoanMouseExited
        if (!kichHoatTaiKhoan) {
            btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_tai_khoan_1.png")));
        }
    }//GEN-LAST:event_btnTaiKhoanMouseExited

    private void btnThongKeMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnThongKeMouseEntered
        if (!kichHoatThongKe) {
            btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_2.png")));
        }
    }//GEN-LAST:event_btnThongKeMouseEntered

    private void btnThongKeMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnThongKeMouseExited
        if (!kichHoatThongKe) {
            btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_thong_ke_1.png")));
        }
    }//GEN-LAST:event_btnThongKeMouseExited

    private void btnQuanTriMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnQuanTriMouseEntered
        if (!kichHoatQuanTri) {
            btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_2.png")));
        }
    }//GEN-LAST:event_btnQuanTriMouseEntered

    private void btnQuanTriMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnQuanTriMouseExited
        if (!kichHoatQuanTri) {
            btnQuanTri.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/button_quan_tri_1.png")));
        }
    }//GEN-LAST:event_btnQuanTriMouseExited

    private void btnHelpMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnHelpMouseEntered
        btnHelp.setForeground(new java.awt.Color(255, 255, 255));
    }//GEN-LAST:event_btnHelpMouseEntered

    private void btnHelpMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnHelpMouseExited
        btnHelp.setForeground(new java.awt.Color(240, 240, 240));
    }//GEN-LAST:event_btnHelpMouseExited

    private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
        new CustomMessageDialog(this, true, "Confirm Message", "Bạn có muốn thoát không ?", CustomMessageDialog.CONFIRM);
        if (CustomMessageDialog.STATUS == CustomMessageDialog.CANCEL) {
            return;
        }
        System.exit(0);
    }//GEN-LAST:event_btnExitActionPerformed

    private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogoutActionPerformed
        // TODO add your handling code here:
        new CustomMessageDialog(this, true, "Confirm Message", "Bạn có muốn đăng xuất không ?", CustomMessageDialog.CONFIRM);
        if (CustomMessageDialog.STATUS == CustomMessageDialog.CANCEL) {
            return;
        }
        dispose();
        DangNhapDAO.quanTri = null;
        new DangNhap(null, true);
    }//GEN-LAST:event_btnLogoutActionPerformed

    private void btnClockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClockActionPerformed
        clickOnClock++;
    }//GEN-LAST:event_btnClockActionPerformed

    private void btnChangePwActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChangePwActionPerformed
        new DoiMatKhau(this, true);
    }//GEN-LAST:event_btnChangePwActionPerformed

    private void btnHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHelpActionPerformed
        new Help(this, false);
    }//GEN-LAST:event_btnHelpActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        new CustomMessageDialog(this, true, "Confirm Message", "Bạn có muốn thoát không ?", CustomMessageDialog.CONFIRM);
        if (CustomMessageDialog.STATUS == CustomMessageDialog.CANCEL) {
            return;
        }
        System.exit(0);
    }//GEN-LAST:event_formWindowClosing

    private void menuHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuHelpActionPerformed
        new Help(this, false);
    }//GEN-LAST:event_menuHelpActionPerformed

    private void mnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnAboutActionPerformed
        new About(this, true);
    }//GEN-LAST:event_mnAboutActionPerformed

    private void mnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnLogoutActionPerformed
        btnLogoutActionPerformed(evt);
    }//GEN-LAST:event_mnLogoutActionPerformed

    private void mnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnExitActionPerformed
        btnExitActionPerformed(evt);
    }//GEN-LAST:event_mnExitActionPerformed

    private void setAdminInfo(QuanTri admin) {
        txtName.setText(admin.getHoTen());
        txtUserID.setText(admin.getEmail());
        pwPass.setText("passwordhere");
    }

    private void callJPanel(JPanel jpanel) {
        mainPanel.removeAll();
        jpanel.setVisible(false);
        mainPanel.add(jpanel, new AbsoluteConstraints(0, 0, mainPanel.getWidth(), mainPanel.getHeight()));
        jpanel.setVisible(true);
    }

    public static void main(String args[]) {
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ATMSystem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ATMSystem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ATMSystem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ATMSystem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                SplashScreen splash = new SplashScreen();
                splash.showSplash();
            }
        });
    }

    public class ThreadTime extends Thread {

        @Override
        public void run() {
            SimpleDateFormat dayFormat = new SimpleDateFormat("EEE, MMM d, yyyy");
            SimpleDateFormat hourFormat = new SimpleDateFormat("HH:mm:ss");
            while (true) {
                Date d = new Date();
                if (clickOnClock % 2 == 0) {
                    lbDateTime.setText(dayFormat.format(d));
                } else {
                    lbDateTime.setText(hourFormat.format(d));
                }
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    System.out.println(e.getMessage());
                }
            }
        }
    }
    public static boolean kichHoatTaiKhoan = false;
    public static boolean kichHoatThongKe = false;
    public static boolean kichHoatQuanTri = false;
    QuanTriController quanTriController = new QuanTriController();
    TaiKhoanController taiKhoanController = new TaiKhoanController();
    ThongKeController thongKeController = new ThongKeController();
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnChangePw;
    private javax.swing.JButton btnClock;
    private javax.swing.JButton btnExit;
    private javax.swing.JButton btnHelp;
    private javax.swing.JButton btnLogout;
    private javax.swing.JButton btnQuanTri;
    private javax.swing.JButton btnTaiKhoan;
    private javax.swing.JButton btnThongKe;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JLabel lbDateTime;
    private javax.swing.JLabel lbImage;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuItem menuHelp;
    private javax.swing.JMenuItem mnAbout;
    private javax.swing.JMenuItem mnExit;
    private javax.swing.JMenuItem mnLogout;
    private javax.swing.JPasswordField pwPass;
    public static javax.swing.JTextField txtName;
    private javax.swing.JTextField txtUserID;
    // End of variables declaration//GEN-END:variables
}
